package com.ylbh.modules.sign.controller;

import com.ylbh.common.annotation.SysLog;
import com.ylbh.common.pojo.sign.vo.RewardAndCountVO;
import com.ylbh.common.pojo.sign.vo.ShoppingSigninPrizeVO;
import com.ylbh.common.pojo.sign.vo.ShoppingSigninRewardVO;
import com.ylbh.common.utils.CommonResult;
import com.ylbh.common.utils.Ref;
import com.ylbh.common.pojo.sign.dto.EntityRewardDTO;
import com.ylbh.modules.sign.service.ShoppingSignTurntableService;
import com.ylbh.modules.sign.service.ShoppingSigninRewardService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author; wjc
 * @date: 2019/12/17
 */
@RestController
@RequestMapping("reward")
public class ShoppingRewardController {

    @Autowired
    private ShoppingSigninRewardService shoppingSigninRewardService;

    @RequestMapping(value = "/addSign", method = {RequestMethod.POST})
    public CommonResult addSign(@RequestBody EntityRewardDTO entitySignDTO) {
        shoppingSigninRewardService.addSign(entitySignDTO);
        return Ref.ok();
    }

    @SysLog("获取签到信息")
    @RequestMapping("getSigRewardList")
    public CommonResult getSigRewardList() {
        RewardAndCountVO vo = shoppingSigninRewardService.getSigRewardList();
        return Ref.ok(vo);
    }

    @SysLog("删除签到信息状态")
    @ApiOperation("删除签到信息状态")
    @RequestMapping("removeRewardEnableState")
    public CommonResult<Void> removeRewardEnableState(){
        shoppingSigninRewardService.removeRewardEnableState();
        return Ref.ok();
    }
}
